(function () {
    // 动态获取各个商品的数据
    $.ajax({
        type: "GET",
        url: "http://193.112.55.79:9090/api/getinlanddiscount",
        dataType: "json",
        success: function (res) {
            var html = template("internal-agio-list", res);
            $("ul").html(html);
        }
    });
    // 返回顶部
    $(".internal-back").on("click",function(){
        document.body.scrollTop = document.documentElement.scrollTop = 0;
    });

    $("ul").on("click","li",function(){
        var index = $(this).attr("index");
        var url = "./scountproduct-detail.php?index="+index;
        window.location.href = url;
    })
})()